POV-Ray : Newsgroups : povray.general : unexpected rotation result : Re: unexpected rotation result Server Time
8 Aug 2024 16:19:41 EDT (-0400)
  Re: unexpected rotation result  
From: Chris Huff
Date: 7 Feb 2001 05:33:16
Message: <chrishuff-95BA06.05341707022001@news.povray.org>
In article <3a811457$1@news.povray.org>, "Tom Melly" 
<tom### [at] tomandlucouk> wrote:

> > Of course there is. It's called simple algebra.
> > a*x^2+b*x+c means what to you?
> 
> (a*(x^2)) + (b*x) + c - but this is not common sense, it is following a
> convention that exists because common sense is not available.
> 
> In fact, one could argue that the only common sense option is to evaluate
> the expression strictly left to right. IMHO common sense would dictate 
> that the solution is: (a*x)^2 + (b*x) + c.

You still followed the precedece of * over +, I think it's even uglier:
((((a * x) ^ 2) + b) * x) + c
Unless you were only talking about individual terms.

I think my exponent patch (which allows you to use ^ for pow() in 
ordinary scene code) breaks on this, instead of evaluating that as:
(a*(x^2)) + (b*x) + c
It will see:
((a*x)^2) + (b*x) + c

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.